<%@include file="/jsps/init.jsp"%>

<liferay-portlet:actionURL portletConfiguration="true" var="configURL"/>

<%
boolean createDate, listenNumber, rating, desc;
%>

<div id="conplexpoll-config">
	<aui:form action="<%=configURL.toString() %>" method="post">
		<aui:fieldset>
			<aui:input type="hidden" name="<%=Constants.CMD %>" value="<%=Constants.UPDATE %>"/>
			
			<aui:select name="[orderByCol]" label="orderByCol">
				<%
				createDate = "createDate".equals(orderByCol);
				listenNumber = "listenNumber".equals(orderByCol);
				rating = "rating".equals(orderByCol);
				%>
				<aui:option value="createDate" label="createDate" selected="<%=createDate %>"/>
				<aui:option value="listenNumber" label="listenNumber" selected="<%= listenNumber %>"/>
				<aui:option value="rating" label="rating" selected="<%= rating %>"/>
			</aui:select>
			
			<aui:select name="[orderByType]" label="orderByType">
				<%
				desc = "DESC".equals(orderByType);
				%>
				<aui:option value="DESC" label="DESC" selected="<%=desc %>"/>
				<aui:option value="ASC" label="ASC" selected="<%= !desc %>"/>
			</aui:select>

			<aui:button type="submit" value="update" />
		</aui:fieldset>
	</aui:form>
</div>